﻿using Newtonsoft.Json;

namespace MBA.FluentExt.Converters
{
	public class JsonEnumCamelConverter : JsonConverter
	{
		#region Methods

		public override bool CanConvert(System.Type objectType)
		{
			return objectType.IsEnum;
		}

		public override object ReadJson(JsonReader reader, System.Type objectType, object existingValue, JsonSerializer serializer)
		{
			throw new System.NotImplementedException();
		}

		public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
		{
			writer.WriteValue(value.ToString().ToLower().ToCamel());
		}

		#endregion Methods
	}
}